babl.git
9 years agoremove deprecated loss struct member
Øyvind Kolås [Mon, 14 Nov 2016 21:09:00 +0000 (22:09 +0100)]
remove deprecated loss struct member

9 years agobabl.db: if git hash has changed, drop cache
Øyvind Kolås [Mon, 14 Nov 2016 19:47:39 +0000 (20:47 +0100)]
babl.db: if git hash has changed, drop cache

9 years agobabl.db: store git rev/version in header
Øyvind Kolås [Mon, 14 Nov 2016 19:42:16 +0000 (20:42 +0100)]
babl.db: store git rev/version in header

9 years agobuild: add generation of git-version.h
Øyvind Kolås [Mon, 14 Nov 2016 17:01:55 +0000 (18:01 +0100)]
build: add generation of git-version.h

9 years agofish cache: sort cached fish paths by descending usage
Øyvind Kolås [Mon, 14 Nov 2016 17:39:16 +0000 (18:39 +0100)]
fish cache: sort cached fish paths by descending usage

9 years agobabl-fish-path: do not allow parallell construction
Øyvind Kolås [Mon, 14 Nov 2016 16:18:36 +0000 (17:18 +0100)]
babl-fish-path: do not allow parallell construction

9 years agobabl_init_db: formats being with first char of line
Øyvind Kolås [Mon, 14 Nov 2016 13:28:31 +0000 (14:28 +0100)]
babl_init_db: formats being with first char of line

9 years agobail on db-cache restoration if format lookup fails
Øyvind Kolås [Mon, 14 Nov 2016 01:30:03 +0000 (02:30 +0100)]
bail on db-cache restoration if format lookup fails

9 years agobabl: cache state between babl runs
Øyvind Kolås [Sun, 13 Nov 2016 23:45:15 +0000 (00:45 +0100)]
babl: cache state between babl runs

Store the contents of discovered babl_paths between runs, for now in
/tmp/babl.db , should move to a per-user dir to make it survive reboots.

The code should also check a versioning string at the start and bail if there
is any mismatch... since the data should be reconstructable; and more reliable
when reconstructed than a possibly old version.

9 years agoPost-release version bump to 0.1.21
Alexandre Prokoudine [Sat, 5 Nov 2016 17:22:41 +0000 (20:22 +0300)]
Post-release version bump to 0.1.21

9 years agoRelease 0.1.20
Alexandre Prokoudine [Sat, 5 Nov 2016 17:14:55 +0000 (20:14 +0300)]
Release 0.1.20

9 years agoUpdate NEWS for 0.1.20
Alexandre Prokoudine [Sat, 5 Nov 2016 17:12:12 +0000 (20:12 +0300)]
Update NEWS for 0.1.20

9 years agoextensions: fast-float: add destroy() callback, fix 2 leaks
Roman Lebedev [Mon, 22 Aug 2016 17:24:14 +0000 (20:24 +0300)]
extensions: fast-float: add destroy() callback, fix 2 leaks

Fixes these 2 not-so-informative leaks, every test showed them:

=================================================================
==27868==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 540276 byte(s) in 1 object(s) allocated from:
    0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
    1 0x7f9cdd208cbb  (<unknown module>)
    2 0x7f9cdd207cca  (<unknown module>)
    3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
    4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
    5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
    6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
    7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
    8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)

Direct leak of 540276 byte(s) in 1 object(s) allocated from:
    0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
    1 0x7f9cdd208cbb  (<unknown module>)
    2 0x7f9cdd207cf6  (<unknown module>)
    3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
    4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
    5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
    6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
    #7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
    8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)

SUMMARY: AddressSanitizer: 1080552 byte(s) leaked in 2 allocation(s).

9 years agobabl-extension: fix BABL_PATH debug warning
Øyvind Kolås [Tue, 30 Aug 2016 22:32:02 +0000 (00:32 +0200)]
babl-extension: fix BABL_PATH debug warning

9 years agobabl-extension: print warning if no extensions were loaded
Øyvind Kolås [Tue, 30 Aug 2016 22:17:24 +0000 (00:17 +0200)]
babl-extension: print warning if no extensions were loaded

9 years agobabl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warnings
Roman Lebedev [Fri, 26 Aug 2016 10:16:51 +0000 (13:16 +0300)]
babl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warnings

9 years agotools: babl-gen-test-pixels: add explicit return 0
Roman Lebedev [Mon, 22 Aug 2016 12:25:31 +0000 (15:25 +0300)]
tools: babl-gen-test-pixels: add explicit return 0

Gcc-4.9 warns:
babl-gen-test-pixels.c: In function ‘main’:
babl-gen-test-pixels.c:170:1: error: control reaches end of non-void function [-Werror=return-type]

9 years agoextensions: gegl-fixups: mark unused functions with attribute
Roman Lebedev [Sun, 21 Aug 2016 11:08:37 +0000 (14:08 +0300)]
extensions: gegl-fixups: mark unused functions with attribute

9 years agoBabl-fish-reference: create_name_internal(): ooops, should return int
Roman Lebedev [Sun, 21 Aug 2016 08:49:26 +0000 (11:49 +0300)]
Babl-fish-reference: create_name_internal(): ooops, should return int

I broke it in 0fe22e1e37197ef6112645bf5a136580c0927a1e
and totally did not even notice the warning...

9 years agoextensions: gggl: conv_rgb8_rgba8(): use 255UL, not 255
Roman Lebedev [Fri, 19 Aug 2016 17:05:17 +0000 (20:05 +0300)]
extensions: gggl: conv_rgb8_rgba8(): use 255UL, not 255

Fixes:
gggl.c:758:62: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

9 years agoextensions: fast-float: babl_lookup(): use 1UL, not just 1
Roman Lebedev [Fri, 19 Aug 2016 17:04:59 +0000 (20:04 +0300)]
extensions: fast-float: babl_lookup(): use 1UL, not just 1

Fixes:

fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

9 years agobabl_fish_reference(), create_name(): add conditional fastpath.
Roman Lebedev [Fri, 19 Aug 2016 12:23:02 +0000 (15:23 +0300)]
babl_fish_reference(), create_name(): add conditional fastpath.

Using __thread keyword.
Although, it is probably not universally avaliable, so this
is just conditional fastpath, if it is detected as unsupported
at compile time, the dumb implementation using malloc() is used.

9 years agobabl_fish_reference(), create_name() are racy
Roman Lebedev [Fri, 19 Aug 2016 18:01:03 +0000 (21:01 +0300)]
babl_fish_reference(), create_name() are racy

create_name_internal() uses global static buffer to create name.
While this is definitely fast, it can't work concurrently.

I used snprintf()+malloc()+snprintf(), so the amount of allocated
memory for the string is optimal.

Alternatively, a mutex would solve the problem, not sure which
solution is faster / better.

9 years agoAdd .kateconfig with modelines for Kate
Roman Lebedev [Thu, 18 Aug 2016 11:01:51 +0000 (14:01 +0300)]
Add .kateconfig with modelines for Kate

Directly follows GIMP HACKING Hackordnung:
  - 2 characters indentation level
  - no tabs. TAB should not put TAB characters in the file.
  - tab stops at 8 column intervals.

9 years agopost release version bump to 0.1.19
Øyvind Kolås [Wed, 15 Jun 2016 05:20:36 +0000 (07:20 +0200)]
post release version bump to 0.1.19

9 years agoRelease 0.1.18
Alexandre Prokoudine [Sun, 12 Jun 2016 23:07:53 +0000 (02:07 +0300)]
Release 0.1.18

9 years agoBug 764628: Gaussian blur: visual glitches
Massimo Valentini [Mon, 30 May 2016 10:45:44 +0000 (12:45 +0200)]
Bug 764628: Gaussian blur: visual glitches

10 years agopost release bump
Øyvind Kolås [Fri, 12 Feb 2016 14:27:10 +0000 (15:27 +0100)]
post release bump

10 years agorelease 0.0.16
Øyvind Kolås [Fri, 12 Feb 2016 14:25:42 +0000 (15:25 +0100)]
release 0.0.16

10 years agoextensions: re-add table based conversions inherited from gggl
Øyvind Kolås [Fri, 12 Feb 2016 11:05:33 +0000 (12:05 +0100)]
extensions: re-add table based conversions inherited from gggl

This code was replaces with the exact code paths in gggl and gggl-lies,
adding these new extensions re-enables the ability to use these
slightly less exact conversions - that possibly also could be fixed
to be exact.

10 years agozero initialize lsb
Massimo Valentini [Tue, 19 Jan 2016 18:07:19 +0000 (19:07 +0100)]
zero initialize lsb

10 years agoextensions: remove inaccurate table based conversions
Øyvind Kolås [Mon, 18 Jan 2016 22:37:09 +0000 (23:37 +0100)]
extensions: remove inaccurate table based conversions

If desired - the table based fast paths should be re-added as separate
extensions.

10 years agobase: half-float reference zero initialize lsb
Massimo Valentini [Sat, 16 Jan 2016 18:33:25 +0000 (19:33 +0100)]
base: half-float reference zero initialize lsb

10 years agobase: remove commented out single/half code
Øyvind Kolås [Sat, 16 Jan 2016 11:08:06 +0000 (12:08 +0100)]
base: remove commented out single/half code

10 years agoextensions: add single to/from half float extension
Øyvind Kolås [Sat, 16 Jan 2016 11:07:21 +0000 (12:07 +0100)]
extensions: add single to/from half float extension

10 years agobase: fix half reference conversion expecting zeroed target
Øyvind Kolås [Sat, 16 Jan 2016 10:16:22 +0000 (11:16 +0100)]
base: fix half reference conversion expecting zeroed target

As discovered in bug #760703 the reference path is currently expecting
zeroed memory, fix by explicitly zeroing last 32bit of mantissa.

10 years agosse2: reuse linear premul/unpremul for gamma formats
Øyvind Kolås [Sun, 10 Jan 2016 23:42:42 +0000 (00:42 +0100)]
sse2: reuse linear premul/unpremul for gamma formats

10 years agoCIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa
Debarshi Ray [Sat, 9 Jan 2016 18:41:29 +0000 (19:41 +0100)]
CIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa

Conversions from "RGB float" to "CIE Lab float" are 10 times slower
without this. One use case is passing a "RGB float" buffer to a
saturation operation that works in the "CIE Lab" colour space.

https://bugzilla.gnome.org/show_bug.cgi?id=760310

10 years agoFix AVX instructions being generated in SSE4.1 code (bug #760292)
Daniel Sabo [Fri, 8 Jan 2016 02:05:44 +0000 (18:05 -0800)]
Fix AVX instructions being generated in SSE4.1 code (bug #760292)

The half-float flag got accidentally added to the SSE4.1 flags,
causing GCC to auto-enable AVX.

10 years agoextensions: Only build sse-half for x86_64.
Michael Henning [Mon, 4 Jan 2016 00:00:29 +0000 (19:00 -0500)]
extensions: Only build sse-half for x86_64.

_mm_insert_epi64 is only available on 64-bit

10 years agoconfigure.ac: Fix the test for compiling half-floating point code.
Michael Henning [Sun, 3 Jan 2016 22:02:38 +0000 (17:02 -0500)]
configure.ac: Fix the test for compiling half-floating point code.

_mm_cvtph_ps is implicitly defined if the compiler does not support
it. So, we need to store its return value in a variable so that
the test fails to type check when the function is implicitly defined
to return an int.

10 years agoAdd support for hardware half<->float conversions
Daniel Sabo [Sun, 27 Dec 2015 15:29:55 +0000 (07:29 -0800)]
Add support for hardware half<->float conversions

These instructions require a Ivy Bridge or newer processor, so I've only
been able to test them under the Intel Software Development Emulator.

10 years agoAdd SSE4.1 u8 -> float conversions
Daniel Sabo [Sun, 20 Dec 2015 11:14:19 +0000 (03:14 -0800)]
Add SSE4.1 u8 -> float conversions

10 years agoAdd SSE4 to babl-cpuaccel
Daniel Sabo [Sun, 20 Dec 2015 11:36:51 +0000 (03:36 -0800)]
Add SSE4 to babl-cpuaccel

10 years agofix bug 755405
Øyvind Kolås [Sat, 21 Nov 2015 02:44:13 +0000 (03:44 +0100)]
fix bug 755405

10 years agopost release version bump
Øyvind Kolås [Thu, 19 Nov 2015 20:26:04 +0000 (21:26 +0100)]
post release version bump

10 years agorelease: 0.1.14
Øyvind Kolås [Thu, 19 Nov 2015 20:05:17 +0000 (21:05 +0100)]
release: 0.1.14

10 years agoNEWS, AUTHORS: updates
Øyvind Kolås [Thu, 19 Nov 2015 20:05:07 +0000 (21:05 +0100)]
NEWS, AUTHORS: updates

10 years agobabl_format_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:59:35 +0000 (16:59 +0300)]
babl_format_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==1657==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fd3026d6c20 at pc 0x7fd3026b6e4a bp 0x7fffaac308a0 sp 0x7fffaac30898
READ of size 4 at 0x7fd3026d6c20 thread T0
    0 0x7fd3026b6e49 in babl_format_new /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317
    1 0x7fd3026bf44f in construct_double_format /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:259
    2 0x7fd3026bfd12 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:204
    3 0x7fd3026acce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    4 0x7fd3026a9379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    5 0x7fd306e5a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    6 0x7fd301f5d238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    7 0x7fd301f5e193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    8 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    9 0x7fd300f71b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    10 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7fd3026d6c23 is located 0 bytes to the right of global variable '*.LC8' from 'babl-model.c' (0x7fd3026d6c20) of size 3
  '*.LC8' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317 babl_format_new
Shadow bytes around the buggy address:
  0x0ffae04d2d70: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 02 f9
=>0x0ffae04d2d80: f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9
  0x0ffae04d2d90: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==1657==ABORTING

10 years agobabl_model_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:57:20 +0000 (16:57 +0300)]
babl_model_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==31464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1c25907940 at pc 0x7f1c258f7636 bp 0x7ffdc4838670 sp 0x7ffdc4838668
READ of size 4 at 0x7f1c25907940 thread T0
    0 0x7f1c258f7635 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114
    1 0x7f1c258e4ce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    2 0x7f1c258e1379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f1c2a0923d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f1c25195238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f1c25196193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f1c241a9b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f1c25907943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f1c25907940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114 babl_model_new
Shadow bytes around the buggy address:
  0x0fe404b18f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe404b18f20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fe404b18f30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==31464==ABORTING

10 years agobabl_component_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:54:21 +0000 (16:54 +0300)]
babl_component_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==28935==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6e2393f940 at pc 0x7f6e23919b5f bp 0x7ffc7b9ca770 sp 0x7ffc7b9ca768
READ of size 4 at 0x7f6e2393f940 thread T0
    0 0x7f6e23919b5e in babl_component_new /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82
    1 0x7f6e2391cbda in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:96
    2 0x7f6e23919379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f6e280ca3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f6e231cd238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f6e231ce193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f6e221e1b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f6e2393f943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f6e2393f940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82 babl_component_new
Shadow bytes around the buggy address:
  0x0fee4471ff10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fee4471ff20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fee4471ff30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==28935==ABORTING

10 years agobabl_type_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:50:55 +0000 (16:50 +0300)]
babl_type_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==25849==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7faec97940 at pc 0x7f7faec8b9bc bp 0x7ffd22ab9210 sp 0x7ffd22ab9208
READ of size 4 at 0x7f7faec97940 thread T0
    0 0x7f7faec8b9bb in babl_type_new /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88
    1 0x7f7faec74ba9 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:90
    2 0x7f7faec71379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f7fb342a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f7fae525238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f7fae526193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f7fad539b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f7faec97943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f7faec97940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88 babl_type_new
Shadow bytes around the buggy address:
  0x0ff075d8af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff075d8af20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0ff075d8af30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==25849==ABORTING

10 years agobabl_parse_double: permit 0 and 9 after .
Øyvind Kolås [Sun, 21 Jun 2015 20:25:41 +0000 (22:25 +0200)]
babl_parse_double: permit 0 and 9 after .

spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.

10 years agoRevert "build: add --enable-installed-tests parameter"
Øyvind Kolås [Fri, 29 May 2015 03:05:32 +0000 (05:05 +0200)]
Revert "build: add --enable-installed-tests parameter"

This reverts commit 1457ff4d59f1e2fccdf7e09e5725a698afbc5d22.

10 years agoFix generation of test pixels
Loren Merritt [Fri, 29 May 2015 00:37:26 +0000 (00:37 +0000)]
Fix generation of test pixels

Most of the test data was zeros. Which produced innacurate benchmarks of any
conversion paths whose speed is data-dependent, such as gamma correction.

10 years agobuild: add --enable-installed-tests parameter
Vadim Rutkovsky [Thu, 7 Aug 2014 15:39:57 +0000 (17:39 +0200)]
build: add --enable-installed-tests parameter

See https://live.gnome.org/GnomeGoals/InstalledTests for more information.
Those tests will also be executed on http://build.gnome.org

It's still possible to run `make check` with locally uninstalled tests.

10 years agoCIE: minor cleanups
Thomas Manni [Wed, 20 May 2015 23:33:54 +0000 (01:33 +0200)]
CIE: minor cleanups

Use macros for kappa, epsilon and D50 reference white in all places
Remove duplicated comments

10 years agoCIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"
Thomas Manni [Wed, 20 May 2015 10:12:35 +0000 (12:12 +0200)]
CIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"

10 years agoDon't create a mutexattr for each mutex
Mukund Sivaraman [Wed, 22 Apr 2015 08:10:06 +0000 (13:40 +0530)]
Don't create a mutexattr for each mutex

10 years agoDon't repeat the malloc/free function pointer change messages
Mukund Sivaraman [Sun, 19 Apr 2015 19:30:58 +0000 (01:00 +0530)]
Don't repeat the malloc/free function pointer change messages

10 years agoRemove unnecessary stat()
Mukund Sivaraman [Sun, 12 Apr 2015 15:17:18 +0000 (20:47 +0530)]
Remove unnecessary stat()

10 years agobabl-mutex: Local headers first, remove unused
Jon Nordby [Wed, 18 Mar 2015 15:19:24 +0000 (16:19 +0100)]
babl-mutex: Local headers first, remove unused

Ensures the feature macros are set for all includes,
and that the public header does not implicitly rely
on any of the headers included in .c file

10 years agobabl-mutex: Define _GNU_SOURCE instead of __USE_GNU
Jon Nordby [Wed, 18 Mar 2015 11:07:01 +0000 (12:07 +0100)]
babl-mutex: Define _GNU_SOURCE instead of __USE_GNU

__USE_GNU should only be set internally by the libc feature detect macros.
On older Debian-based systems, as used by Heroku cedar-10 stack, this failed
to provide the definition of PTHREAD_MUTEX_RECURSIVE

11 years agoDisplay whether a format is planar
Mukund Sivaraman [Sun, 1 Mar 2015 10:57:55 +0000 (16:27 +0530)]
Display whether a format is planar

11 years agoSupport more than 100 formats
Mukund Sivaraman [Sun, 1 Mar 2015 07:56:05 +0000 (13:26 +0530)]
Support more than 100 formats

11 years agoFix another place where assigned_name can be NULL
Mukund Sivaraman [Thu, 26 Feb 2015 15:03:16 +0000 (20:33 +0530)]
Fix another place where assigned_name can be NULL

11 years agoAllow up to (and including) BABL_MAX_COMPONENTS
Mukund Sivaraman [Thu, 26 Feb 2015 14:51:18 +0000 (20:21 +0530)]
Allow up to (and including) BABL_MAX_COMPONENTS

11 years agoAvoid shadowing babl variable
Mukund Sivaraman [Thu, 26 Feb 2015 14:46:23 +0000 (20:16 +0530)]
Avoid shadowing babl variable

11 years agoUse common return
Mukund Sivaraman [Thu, 26 Feb 2015 14:40:35 +0000 (20:10 +0530)]
Use common return

11 years agoassigned_name can be NULL, causing segfault
Mukund Sivaraman [Thu, 26 Feb 2015 14:37:46 +0000 (20:07 +0530)]
assigned_name can be NULL, causing segfault

11 years agoRemove deadcode
Mukund Sivaraman [Thu, 26 Feb 2015 14:32:38 +0000 (20:02 +0530)]
Remove deadcode

11 years agoFix type max value for consistency
Mukund Sivaraman [Thu, 26 Feb 2015 14:27:14 +0000 (19:57 +0530)]
Fix type max value for consistency

11 years agoRemove workaround for non-recursive mutexes.
Nils Philippsen [Fri, 13 Feb 2015 12:29:13 +0000 (13:29 +0100)]
Remove workaround for non-recursive mutexes.

This workaround caused concurrency-stress-test to fail occasionally.
Meanwhile BablMutex wraps pthread mutexes in a way that they are
initialized as recursive.

This partially reverts commit 9d2aa7d13ac421935de1e87301c48af50b0ceb59.

11 years agoMake BablMutex recursive on all platforms.
Nils Philippsen [Fri, 13 Feb 2015 12:24:52 +0000 (13:24 +0100)]
Make BablMutex recursive on all platforms.

Win32 Critical Sections are recursive locks, initialize pthread mutexes
as recursive as well.

11 years agoChange constants to match built-in sRGB profiles. modified: babl/base/rgb-constants.h
Elle Stone [Sat, 7 Feb 2015 17:12:46 +0000 (12:12 -0500)]
Change constants to match built-in sRGB profiles. modified: babl/base/rgb-constants.h

11 years agopost release version bump
Øyvind Kolås [Tue, 3 Feb 2015 17:41:07 +0000 (18:41 +0100)]
post release version bump

11 years agorelease 0.1.12
Øyvind Kolås [Tue, 3 Feb 2015 17:40:47 +0000 (18:40 +0100)]
release 0.1.12

11 years agoNEWS: update
Øyvind Kolås [Tue, 3 Feb 2015 17:35:25 +0000 (18:35 +0100)]
NEWS: update

11 years agoAUTHORS: add more people
Øyvind Kolås [Tue, 3 Feb 2015 17:05:20 +0000 (18:05 +0100)]
AUTHORS: add more people

11 years agoCIE: minor cleanups
Øyvind Kolås [Tue, 30 Dec 2014 02:07:41 +0000 (03:07 +0100)]
CIE: minor cleanups

Update copyright block, some reindentation and removal of some dead/obsolete
comments and code.

11 years agotest: update srgb_to_lab_u8 test
Øyvind Kolås [Tue, 30 Dec 2014 01:52:27 +0000 (02:52 +0100)]
test: update srgb_to_lab_u8 test

11 years agoModify CIE color space conversions to use D50-adapted sRGB
Elle Stone [Mon, 29 Dec 2014 21:42:50 +0000 (16:42 -0500)]
Modify CIE color space conversions to use D50-adapted sRGB

11 years agoroadmap: make statement about tentativeness more explicit
Øyvind Kolås [Sun, 16 Nov 2014 03:11:36 +0000 (03:11 +0000)]
roadmap: make statement about tentativeness more explicit

also add comment about significance of rounding errors relative to sensor/CCD
precision.

11 years agospell out roadmap with more detailed overview
Øyvind Kolås [Sat, 11 Oct 2014 18:37:11 +0000 (20:37 +0200)]
spell out roadmap with more detailed overview

11 years agodocs: added a roadmap/architecture document.
Øyvind Kolås [Thu, 9 Oct 2014 17:16:38 +0000 (19:16 +0200)]
docs: added a roadmap/architecture document.

11 years agobabl: Fix message printed when memory function pointers don't match
Mukund Sivaraman [Wed, 3 Sep 2014 04:39:55 +0000 (10:09 +0530)]
babl: Fix message printed when memory function pointers don't match

11 years agoextensions: Register CMYK u8 format
Jon Nordby [Mon, 11 Aug 2014 23:48:21 +0000 (01:48 +0200)]
extensions: Register CMYK u8 format

11 years agoextensions: Fix M/Y channels swapped for CMYK float
Jon Nordby [Mon, 11 Aug 2014 23:45:13 +0000 (01:45 +0200)]
extensions: Fix M/Y channels swapped for CMYK float

Pretty sure CMYK should have channel order cmyk and not cymk

11 years agoRemove extra programming languages from the doap file.
Michael Henning [Thu, 7 Aug 2014 23:45:05 +0000 (19:45 -0400)]
Remove extra programming languages from the doap file.

11 years agoDOAP file: add Ruby programming language.
Sven Claussner [Thu, 7 Aug 2014 17:47:58 +0000 (19:47 +0200)]
DOAP file: add Ruby programming language.

11 years agoFix DOAP file
Sven Claussner [Wed, 6 Aug 2014 19:42:17 +0000 (21:42 +0200)]
Fix DOAP file

Remove category.
Remove M4 programming language, because we don't develop with it
(only the Autotools use it internally).

11 years agoUpdate babl.doap and AUTHORS
Sven Claussner [Sun, 3 Aug 2014 05:38:39 +0000 (07:38 +0200)]
Update babl.doap and AUTHORS

Make babl.doap compliant to the new DOAP file style (GUADEC 2014):
* Add new mandatory fields 'description' and 'programming-language'.
* Add field 'category'

Add bug tracker URL.
Update mailing list adress.
Remove trailing white spaces.
Add me to AUTHORS.

11 years agoFix crash if failing to normalize path for loading extensions
Jon Nordby [Fri, 18 Jul 2014 16:00:20 +0000 (18:00 +0200)]
Fix crash if failing to normalize path for loading extensions

Can for instance happen when running with "BABL_PATH=something:",
which easily happens in scripts on form BABL_PATH=something:${BABL_PATH}

11 years agobabl: make malloc implementation stability sanity check non-fatal
Øyvind Kolås [Wed, 2 Jul 2014 04:20:13 +0000 (06:20 +0200)]
babl: make malloc implementation stability sanity check non-fatal

11 years agoextensions: use more integer instructions for float lookups
Øyvind Kolås [Sun, 29 Jun 2014 19:22:14 +0000 (21:22 +0200)]
extensions: use more integer instructions for float lookups

11 years agoextension: make rgb8 to rgba8 conversion faster
Øyvind Kolås [Sun, 29 Jun 2014 18:15:11 +0000 (20:15 +0200)]
extension: make rgb8 to rgba8 conversion faster

For all pixels but the last one, do a 32bit load/store + 8bit immediate store
instead of byte by byte copying.

11 years agoadd internal babl_parse_double; to avoid using atof
Øyvind Kolås [Mon, 9 Jun 2014 00:30:38 +0000 (02:30 +0200)]
add internal babl_parse_double; to avoid using atof

atof is locale dependent; it was being used two places parsing floating point
values from environment variables.

11 years agoextend conversions to n_components to pad with 0s
Øyvind Kolås [Mon, 28 Apr 2014 21:36:04 +0000 (23:36 +0200)]
extend conversions to n_components to pad with 0s

Test coverage updated to check these cases.

11 years agoimprove how RGBA buffers are copied to n_component
Øyvind Kolås [Mon, 28 Apr 2014 13:34:51 +0000 (15:34 +0200)]
improve how RGBA buffers are copied to n_component

11 years agoadd n_components casting test
Øyvind Kolås [Mon, 28 Apr 2014 13:49:39 +0000 (15:49 +0200)]
add n_components casting test